home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d27 / autoflex.arc / KEYSDOWN.DOC < prev    next >
Text File  |  1990-06-15  |  2KB  |  65 lines

  1. KEYSDOWN.COM is taken from July 1990 PC COMPUTING, page 218.
  2.  
  3. This short program will scan to see if the CAPLOCK, NUMLOCK or SCROLL
  4. LOCK keys are on & if so return one of the errorlevels below:
  5.  
  6. ** Scroll lock on returns an errorlevel of 16
  7. ** Num lock on returns an errorlevel of 32
  8. ** Cap lock on returns an errorlevel of 64
  9.  
  10. This in turn allows for the following type of batch file:
  11.  
  12. if not errorlevel 64 goto end
  13. some command to be performed only if CAPLOCK key on
  14. :end
  15.  
  16.  
  17. Of course you substitute the appropriate errorlevel of your choice
  18. per the above and you can use the positive as well as the negative
  19. statement.  Also remember that standard DOS will treat any number equal
  20. to or greater then the given errorlevel number as a match.  Thus if any
  21. of the three above lock keys are on "if errorlevel 16" will be matched.
  22. (If you have the command.com substitute 4DOS you can require an exact
  23. match with "if errorlevel EQ 16" etc.).
  24.  
  25. WHY THIS IS AN INVALUABLE PROGRAM:
  26.  
  27. Keysdown.com can be used in an autoexec.bat to perform certain
  28. commands if the lock key in question has been depressed after
  29. the lock keys given their initial `flash on' during the config.sys
  30. routine.  This means that you can have your standard autoexec routine
  31. run automatically unless you affirmatively choose to branch by pressing
  32. one of the lock keys.  No menus, no muss, no fuss.  (Using 4DOS [see
  33. note above] I have my machine set up to go to a menu without TSRs
  34. routinely; go to the comm program directly if caplock is pressed; go to
  35. the word processor directly if the scroll lock is pressed; and load
  36. a TSR package and go to the menu if the num lock is pressed).  Note that
  37. some machines automatically turn the num lock key to on upon booting.
  38.  
  39. I also include two other small programs.
  40.  
  41. NUMLKOFF.COM which will turn the numlock key to off; and
  42. LOCKOFF.COM which will turn all three lock keys (num, cap & scroll) to
  43. off.
  44.  
  45. NOW IF SOMEONE COULD DEVELOPE A ROUTINE TO EFFECT THE SAME `no menus'
  46. BRANCHING OFF OF THE CONFIG.SYS ALL WOULD TRULY BE GRAND.
  47.  
  48.  
  49. KEYSDOWN.COM was compiled from the following debug script (using the
  50. command `debug < keysdown.scr'):
  51.  
  52. KEYSDOWN.SCR (blank line after int 21 must be there)
  53.  
  54. n keysdown.com
  55. a
  56. mov ah,2
  57. int 16
  58. mov ah,4c
  59. int 21
  60.  
  61. rcx
  62. 8
  63. w
  64. q
  65.